
#include"proc.h"

#define SIZE 102

void process()
{
  char arr[SIZE]={0};
  char* lable = "|/-\\";
  int i =0;
  arr[0] = '>';
  while(i <= 100)
  {
   // \033[47;31mThis is a color test.\033[0m
   
    printf("%-100s[%%%d]%c\r",arr,i,lable[(i/5)%4]);
  
    fflush(stdout);
    usleep(30000);
    arr[i] = '-';
    if(i+1 <= 99)
    {
       arr[i+1] = '>';
    }
    i++;
  }
  printf("\n");



}

void coprocess()
{

  char* lable = "|/-\\";
  int i =0;
  while(i <= 100)
  {
    for(int j = 0;j <i ;j++)
    {
      printf("\033[36;46m \033[0m");
    }
    for(int j = i;j<100;j++)
    {
       printf("\033[42;32m \033[0m");
    }
    printf("[%%%d]%c\r",i,lable[(i/5)%4]);
    fflush(stdout);
    usleep(30000);
    i++;
  }
  printf("\n");

}










